From: Keir Fraser Date: Mon, 19 Apr 2010 10:34:49 +0000 (+0100) Subject: x86: Simplify freeze_domains() and thaw_domains(). Since they now X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~12341 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=5fa9cbb8057b000f7e47f1305408fc0865fa2c23;p=xen.git x86: Simplify freeze_domains() and thaw_domains(). Since they now run in idle-vcpu context, no care needs to be taken about pausing 'current'. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c index e6847b3e4f..9efae905c2 100644 --- a/xen/arch/x86/acpi/power.c +++ b/xen/arch/x86/acpi/power.c @@ -77,46 +77,25 @@ static void device_power_up(void) static void freeze_domains(void) { struct domain *d; - struct vcpu *v; rcu_read_lock(&domlist_read_lock); + /* + * Note that we iterate in order of domain-id. Hence we will pause dom0 + * first which is required for correctness (as only dom0 can add domains to + * the domain list). Otherwise we could miss concurrently-created domains. + */ for_each_domain ( d ) - { - switch ( d->domain_id ) - { - case 0: - for_each_vcpu ( d, v ) - if ( v != current ) - vcpu_pause(v); - break; - default: - domain_pause(d); - break; - } - } + domain_pause(d); rcu_read_unlock(&domlist_read_lock); } static void thaw_domains(void) { struct domain *d; - struct vcpu *v; rcu_read_lock(&domlist_read_lock); for_each_domain ( d ) - { - switch ( d->domain_id ) - { - case 0: - for_each_vcpu ( d, v ) - if ( v != current ) - vcpu_unpause(v); - break; - default: - domain_unpause(d); - break; - } - } + domain_unpause(d); rcu_read_unlock(&domlist_read_lock); }